package masterlink.util;

import java.util.Calendar;
import java.util.GregorianCalendar;

public class Util {
	
	public static int compTimeNum(int time){
		int a=time / 100;
		int b=a / 100;
		switch(b){
		case 9:
			a = a - 900;
			break;
		case 10:
			a = (a - 1000) + 60;
			break;
		case 11:
			a = (a - 1100) + 60 * 2;
			break;
		case 12:
			a = (a - 1200) + 60 * 3;
			break;
		case 13:
			a = (a - 1300) + 60 * 4;
			break;
		}
		return a;
	}
	
	public static boolean isEmpty(String a){
		if(a==null || a.trim().length()==0){
			return true;
		}
		return false;
	}
	public static int getTickTime(int tick){
		GregorianCalendar cal=new GregorianCalendar();
		cal.set(Calendar.HOUR_OF_DAY,9);
		cal.set(Calendar.MINUTE, 0);
		cal.set(Calendar.SECOND, 0);
		cal.set(Calendar.MILLISECOND, 0);
		cal.add(Calendar.MINUTE, tick);
		//System.out.println(cal.getTime().toString());
		//System.out.println("Hour : "+cal.get(Calendar.HOUR_OF_DAY));
		//System.out.println("Min : "+cal.get(Calendar.MINUTE));
		int hour=cal.get(Calendar.HOUR_OF_DAY)*100;
		int min=cal.get(Calendar.MINUTE);
		return hour+min;
	}
}
